using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_DiscountMap : EntityTypeConfiguration<t_Discount>
    {
        public t_DiscountMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FInterID, t.FCustomerID, t.FItemID });

            // Properties
            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.FCustomerID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("t_Discount");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FCustomerID).HasColumnName("FCustomerID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FLBound).HasColumnName("FLBound");
            this.Property(t => t.FUBound).HasColumnName("FUBound");
            this.Property(t => t.FBoundQA).HasColumnName("FBoundQA");
            this.Property(t => t.FValue).HasColumnName("FValue");
            this.Property(t => t.FValueQA).HasColumnName("FValueQA");
            this.Property(t => t.FRate).HasColumnName("FRate");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FExpireDate).HasColumnName("FExpireDate");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FQuoteTime).HasColumnName("FQuoteTime");
            this.Property(t => t.FUsed).HasColumnName("FUsed");
        }
    }
}
